package edebe.flyinginstrument.loader;

import edebe.flyinginstrument.entity.EntityFlySword;
import edebe.flyinginstrument.FlyingInstrumentMod;
import edebe.flyinginstrument.entity.EntityFlyingInstrument;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.EntityEntry;
import net.minecraftforge.fml.common.registry.EntityEntryBuilder;
import net.minecraftforge.registries.IForgeRegistry;

@Mod.EventBusSubscriber
public final class EntityLoader {
    private static int index = 0;

    public static void registerEntities() {
//        EntityRegistry.registerModEntity(new ResourceLocation(FlyingInstrumentMod.MODID, "EntityFlyingInstrument"), EntityFlyingInstrument.class, FlyingInstrumentMod.MODID + ".FlyingInstrument", index++, FlyingInstrumentMod.instance, 64, 1, true);
//        EntityRegistry.registerModEntity(new ResourceLocation(FlyingInstrumentMod.MODID, "EntityFlySword"), EntityFlySword.class, FlyingInstrumentMod.MODID + ".FlySword", index++, FlyingInstrumentMod.instance, 64, 1, true);
    }




    public static final EntityEntry EntityFlyingInstrument =
            EntityEntryBuilder.create().entity(edebe.flyinginstrument.entity.EntityFlyingInstrument.class)
                    .id("FlyingInstrument", index++).name(FlyingInstrumentMod.MODID + ".FlyingInstrument").tracker(64, 10, true).build();


    public static final EntityEntry EntityFlySword =
            EntityEntryBuilder.create().entity(EntityFlySword.class)
                    .id("EntityFlySword", index++).name(FlyingInstrumentMod.MODID + ".EntityFlySword").tracker(64, 10, true).build();







    @SubscribeEvent
    public static void onRegistry(RegistryEvent.Register<EntityEntry> event)
    {
        IForgeRegistry<EntityEntry> registry = event.getRegistry();
        registry.register(EntityFlyingInstrument);
        registry.register(EntityFlySword);
    }
}